package com.wh.influxdb.common.core.convertor;

import java.time.LocalDateTime;

import static com.wh.influxdb.common.utils.TimeUtil.nanosToTime;
import static com.wh.influxdb.common.utils.TimeUtil.timeToNanos;


/**
 * @Author: xu
 * @Date: 2025/1/16
 * @Description:
 **/
public class LocalDateTimeNanosConvertor implements Convertor<LocalDateTime, Long> {

    @Override
    public LocalDateTime toJavaValue(Long nanos) {
        return nanosToTime(nanos);
    }

    @Override
    public Long toSaveValue(LocalDateTime localDateTime) {
        return timeToNanos(localDateTime);
    }
}
